﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SoundSynth.Oscillators
{
    public class SawtoothOscillator:BaseOscillator
    {
        public SawtoothOscillator() : base() { }
        public override float GetNext(float timedomain)
        {
            // 2 * ( t/a - floor( t/a + 1/2 ) )
            return 2f * (timedomain - (float)Math.Floor(timedomain + 0.5f));
        }
    }
}
